# -!- coding: utf-8 -!-
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
海拍客第三方征信字段传入规则引擎
# 文件：credit_flow_.py
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

# 283
credit_info = {
    "applyLoanAmt":"50000",
    "baiHangD14CreditPlatfromNumber":"0",
    "baiHangD14CreditQueryNumber":"0",
    "baiHangD14InLoanPlatfromNumber":"0",
    "baiHangD14InLoanQueryNumber":"0",
    "baiHangD14ObjectionHandlingPlatfromNumber":"0",
    "baiHangD14ObjectionHandlingQueryNumber":"0",
    "baiHangD14PersonalPlatfromNumber":"0",
    "baiHangD14PersonalQueryNumber":"0",
    "baiHangD14PostLoanPlatfromNumber":"0",
    "baiHangD14PostLoanQueryNumber":"0",
    "baiHangD14SecuredPlatfromNumber":"0",
    "baiHangD14SecuredQueryNumber":"0",
    "baiHangD14TotalPlatfromNumber":"0",
    "baiHangD14TotalQueryNumber":"0",
    "baiHangD180CreditPlatfromNumber":"0",
    "baiHangD180CreditQueryNumber":"0",
    "baiHangD180InLoanPlatfromNumber":"0",
    "baiHangD180InLoanQueryNumber":"0",
    "baiHangD180NonRevApplyTenantCount":"-1",
    "baiHangD180NonRevAverageLoanAmount":"0",
    "baiHangD180NonRevLoanAmount":"0",
    "baiHangD180NonRevLoanCount":"0",
    "baiHangD180NonRevLoanTenantCount":"0",
    "baiHangD180NonRevMaxLoanAmount":"0",
    "baiHangD180NonRevOverdueLoanCount":"0",
    "baiHangD180ObjectionHandlingPlatfromNumber":"0",
    "baiHangD180ObjectionHandlingQueryNumber":"0",
    "baiHangD180PersonalPlatfromNumber":"0",
    "baiHangD180PersonalQueryNumber":"0",
    "baiHangD180PostLoanPlatfromNumber":"0",
    "baiHangD180PostLoanQueryNumber":"0",
    "baiHangD180RevAccountCount":"0",
    "baiHangD180RevApplyTenantCount":"-1",
    "baiHangD180RevCreditLimitSum":"0",
    "baiHangD180RevLendingAmount":"0",
    "baiHangD180RevOverdueAccountCount":"0",
    "baiHangD180SecuredPlatfromNumber":"0",
    "baiHangD180SecuredQueryNumber":"0",
    "baiHangD180TotalPlatfromNumber":"0",
    "baiHangD180TotalQueryNumber":"0",
    "baiHangD270CreditPlatfromNumber":"0",
    "baiHangD270CreditQueryNumber":"0",
    "baiHangD270InLoanPlatfromNumber":"0",
    "baiHangD270InLoanQueryNumber":"0",
    "baiHangD270ObjectionHandlingPlatfromNumber":"0",
    "baiHangD270ObjectionHandlingQueryNumber":"0",
    "baiHangD270PersonalPlatfromNumber":"0",
    "baiHangD270PersonalQueryNumber":"0",
    "baiHangD270PostLoanPlatfromNumber":"0",
    "baiHangD270PostLoanQueryNumber":"0",
    "baiHangD270SecuredPlatfromNumber":"0",
    "baiHangD270SecuredQueryNumber":"0",
    "baiHangD270TotalPlatfromNumber":"0",
    "baiHangD270TotalQueryNumber":"0",
    "baiHangD30CreditPlatfromNumber":"0",
    "baiHangD30CreditQueryNumber":"0",
    "baiHangD30InLoanPlatfromNumber":"0",
    "baiHangD30InLoanQueryNumber":"0",
    "baiHangD30NonRevApplyTenantCount":"-1",
    "baiHangD30NonRevAverageLoanAmount":"0",
    "baiHangD30NonRevLoanAmount":"0",
    "baiHangD30NonRevLoanCount":"0",
    "baiHangD30NonRevLoanTenantCount":"0",
    "baiHangD30NonRevMaxLoanAmount":"0",
    "baiHangD30NonRevOverdueLoanCount":"0",
    "baiHangD30ObjectionHandlingPlatfromNumber":"0",
    "baiHangD30ObjectionHandlingQueryNumber":"0",
    "baiHangD30PersonalPlatfromNumber":"0",
    "baiHangD30PersonalQueryNumber":"0",
    "baiHangD30PostLoanPlatfromNumber":"0",
    "baiHangD30PostLoanQueryNumber":"0",
    "baiHangD30RevAccountCount":"0",
    "baiHangD30RevApplyTenantCount":"-1",
    "baiHangD30RevCreditLimitSum":"0",
    "baiHangD30RevLendingAmount":"0",
    "baiHangD30RevOverdueAccountCount":"0",
    "baiHangD30SecuredPlatfromNumber":"0",
    "baiHangD30SecuredQueryNumber":"0",
    "baiHangD30TotalPlatfromNumber":"0",
    "baiHangD30TotalQueryNumber":"0",
    "baiHangD360CreditPlatfromNumber":"0",
    "baiHangD360CreditQueryNumber":"0",
    "baiHangD360InLoanPlatfromNumber":"0",
    "baiHangD360InLoanQueryNumber":"0",
    "baiHangD360NonRevApplyTenantCount":"-1",
    "baiHangD360NonRevAverageLoanAmount":"0",
    "baiHangD360NonRevLoanAmount":"0",
    "baiHangD360NonRevLoanCount":"0",
    "baiHangD360NonRevLoanTenantCount":"0",
    "baiHangD360NonRevMaxLoanAmount":"0",
    "baiHangD360NonRevOverdueLoanCount":"0",
    "baiHangD360ObjectionHandlingPlatfromNumber":"0",
    "baiHangD360ObjectionHandlingQueryNumber":"0",
    "baiHangD360PersonalPlatfromNumber":"0",
    "baiHangD360PersonalQueryNumber":"0",
    "baiHangD360PostLoanPlatfromNumber":"0",
    "baiHangD360PostLoanQueryNumber":"0",
    "baiHangD360RevAccountCount":"0",
    "baiHangD360RevApplyTenantCount":"-1",
    "baiHangD360RevCreditLimitSum":"0",
    "baiHangD360RevLendingAmount":"0",
    "baiHangD360RevOverdueAccountCount":"0",
    "baiHangD360SecuredPlatfromNumber":"0",
    "baiHangD360SecuredQueryNumber":"0",
    "baiHangD360TotalPlatfromNumber":"0",
    "baiHangD360TotalQueryNumber":"0",
    "baiHangD7CreditPlatfromNumber":"0",
    "baiHangD7CreditQueryNumber":"0",
    "baiHangD7InLoanPlatfromNumber":"0",
    "baiHangD7InLoanQueryNumber":"0",
    "baiHangD7ObjectionHandlingPlatfromNumber":"0",
    "baiHangD7ObjectionHandlingQueryNumber":"0",
    "baiHangD7PersonalPlatfromNumber":"0",
    "baiHangD7PersonalQueryNumber":"0",
    "baiHangD7PostLoanPlatfromNumber":"0",
    "baiHangD7PostLoanQueryNumber":"0",
    "baiHangD7SecuredPlatfromNumber":"0",
    "baiHangD7SecuredQueryNumber":"0",
    "baiHangD7TotalPlatfromNumber":"0",
    "baiHangD7TotalQueryNumber":"0",
    "baiHangD90CreditPlatfromNumber":"0",
    "baiHangD90CreditQueryNumber":"0",
    "baiHangD90InLoanPlatfromNumber":"0",
    "baiHangD90InLoanQueryNumber":"0",
    "baiHangD90NonRevApplyTenantCount":"-1",
    "baiHangD90NonRevAverageLoanAmount":"0",
    "baiHangD90NonRevLoanAmount":"0",
    "baiHangD90NonRevLoanCount":"0",
    "baiHangD90NonRevLoanTenantCount":"0",
    "baiHangD90NonRevMaxLoanAmount":"0",
    "baiHangD90NonRevOverdueLoanCount":"0",
    "baiHangD90ObjectionHandlingPlatfromNumber":"0",
    "baiHangD90ObjectionHandlingQueryNumber":"0",
    "baiHangD90PersonalPlatfromNumber":"0",
    "baiHangD90PersonalQueryNumber":"0",
    "baiHangD90PostLoanPlatfromNumber":"0",
    "baiHangD90PostLoanQueryNumber":"0",
    "baiHangD90RevAccountCount":"0",
    "baiHangD90RevApplyTenantCount":"-1",
    "baiHangD90RevCreditLimitSum":"0",
    "baiHangD90RevLendingAmount":"0",
    "baiHangD90RevOverdueAccountCount":"0",
    "baiHangD90SecuredPlatfromNumber":"0",
    "baiHangD90SecuredQueryNumber":"0",
    "baiHangD90TotalPlatfromNumber":"0",
    "baiHangD90TotalQueryNumber":"0",
    "baiHangMobileCount":"0",                          # 手机号数量-->personalProfile.MobileCount-->
    "baiHangNonRevLoanCount":"0",
    "baiHangNonRevMaxOverdueStatus":"N",
    "baiHangNonRevOpenLoanCount":"0",
    "baiHangNonRevOverdueCount":"0",
    "baiHangNonRevRemainingAmount":"0",
    "baiHangNonRevRemainingMaxOverdueStatus":"N",
    "baiHangNonRevRemainingOverdueAmount":"0",
    "baiHangNonRevRemainingOverdueLoanCount":"0",
    "baiHangRevAccountCount":"0",
    "baiHangRevCreditLimitSum":"0",
    "baiHangRevMaxCreditLimitPerTenant":"0",
    "baiHangRevMaxOverdueStatus":"N",
    "baiHangRevOverdueCount":"0",
    "baiHangRevRemainingAmount":"0",
    "baiHangRevRemainingMaxOverdueStatus":"N",
    "baiHangRevRemainingOverdueAccountCount":"0",
    "baiHangRevRemainingOverdueAmount":"0",
    "baiHangRevValidAccountCount":"0",
    "baiHangTel3Verify": "0",                    # 百行三要素接口0-一致，1、2、3不一致，-1-已查无数据，-2-查询异常 20200420V1.4
    #"baiRongTelConsume":"2",                        # 2020-08-11 iteration-2.5.6-dev 下架
    #"baiRongTelOperation":"3",
    #"baiRongTelPeriod":"4",
    #"baiRongTelStatus":"1",
    "creditAddressCityCode":"110100",             # 家庭住址市编码（授信）：申请人信息页面的居住地址
    "creditAge":"32",                             # 从客户身份证号计算
    "creditBlkBankCardHitBankCard":"0",           # 授信-客户银行卡号码命中黑名单银行卡号码
    "creditBlkBankMblNoHitMblNo":"-989",          # 授信-目标客户银行卡绑定手机号命中黑名单手机号-->Phone
    "creditBlkDeviceidHitDeviceid":"-989",        # 授信-客户设备ID命中黑名单设备ID
    "creditBlkDirectContactHitMblNo":"0",         # 授信-客户直系联系人命中黑名单手机号-->RelativeContact
    "creditBlkIdCardHitIdCard":"0",               # 授信-客户身份证命中黑名单身份证
    "creditBlkMblNoHitMblNo":"0",                 # 授信-客户手机号命中黑名单手机号
    "creditBlkNo2ContactHitMblNo":"-989",         # 授信-目标客户第二联系人命中黑名单手机号-->OtherContact
    "creditContactRelation":"1",                     # 紧急联系人关系(授信)：1-配偶 2-父母 3-子女
    "creditCusSex":"1",                              # 从客户身份证号计算：倒数第一位0:女，1:男
    "creditIdCardPD":"5893",                         # 授信传入的身份有效期距今的天数，如身份证有效期2019-8-24，申请进件时间2019-8-17，则返回7
    "creditMaritalSta":"1",                          # 1-已婚 2-未婚 3-离异 4-丧偶 5-其他
    #"creditOperator3Verify":"Y",                     # 天创运营商三要素验证  Y-一致、N-不一致  20200728master下架
    "dianHuaBangTelConsume": "12",                    # result_204手机消费档次：11-移动、电信[0,50]     2020-08-11 iteration-2.5.6-dev 上架
    "dianHuaBangTelOperation": "移动",                 # result_211运营商 电信，移动，联通，-989-未查得
    "dianHuaBangTelPeriod": "1",                      # result_202在网时长 3-表示月数为 (6,12]
    "dianHuaBangTelStatus": "0",                      # result_216在网状态 1-在用，2-停用
    "faceLiteResultFaceidConfidence":"89.758",       # Face++人脸比对综合分数置信度
    "haiPaiKeAverageOrderAmountInSixMonths":"5000",    # 近六个月月均订单额(元)-->totalOrderAmountInSixMonths/6-->order_amt_six_month
    "haiPaiKeAverageOrdersInSixMonths":"1",           # 近六个月月均订单数-->totalOrdersInSixMonths/6-->order_six_month
    "haiPaiKeDataUpdateTimeToSystemIntervalDay": 3,   # 海拍客经营数据更新日期与进入决策系统间隔天数 mch_trans_info.u_time
    "haiPaiKeMaxOrderAmountInSixMonths":"5000",       # 近六个月最大订单额(元)-->maxOrderAmountInSixMonths-->max_amt_six_month
    "haiPaiKeOrderMonthsInHalfAYear":"3",             # 近半年产生订单的月份数-->orderMonthsInHalfAYear-->order_month_half_year
    "haiPaiKeOrderMonthsInOneYear": "7",              # 海拍客近一年产生订单的月份总和-->orderMonthsInOneYear-->order_month_one_year
    "haiPaiKeRegisteredDays":"10",                    # 海拍客注册有效天数-->补充信息接口-registeredDays-->registered_days
    "haiPaiKeTotalOrderAmountInOneMonth":"5000",      # 海拍客近一个月总订单额-totalOrderAmountInOneMonth-->order_amt_one_month
    "haiPaiKeTotalOrderAmountInOneYear": "60000",     # 海拍客近一年总订单额-totalOrderAmountInOneYear-->order_amt_one_year
    "haiPaiKeTotalOrderAmountInSixMonths": "30000",   # 海拍客近六个月总订单额-totalOrderAmountInSixMonths-->order_amt_six_month
    "haiPaiKeTotalOrderAmountInThreeMonths": "20000", # 海拍客近三个月总订单额-totalOrderAmountInThreeMonths-->order_amt_three_month
    "haiPaiKeTotalOrdersInOneMonth": "2",             # 海拍客近一个月的订单总数-totalOrdersInOneMonth-->order_one_month
    "haiPaiKeTotalOrdersInOneYear": "3",              # 海拍客近一年总订单数-totalOrdersInOneYear-->total_order_one_year
    "haiPaiKeTotalOrdersInThreeMonths":"6",           # 海拍客近三个月的订单总数-totalOrdersInThreeMonths-->order_three_month
    "haiPaiKeTotalRefundAmountInOnMonth": "2000",     # 海拍客近一个月退货总额-totalRefundAmountInOnMonth-->refund_amt_one_month
    "haiPaiKeTotalRefundAmountInOneYear": "5000",     # 海拍客近一年退货总额-totalRefundAmountInOneYear-->refund_amt_one_year
    "haiPaiKeTotalRefundOrdersInOneYear": "2",        # 海拍客近一年的退货订单总数-totalRefundOrdersInOneYear-->total_refund_one_year
    "idcard":"36242219881103431X",
    "mobile":"15917374871",
    "name":"曾令为",
    "processNo":"MSXDHIPAC20200117968163wv9E4B",
    "qiChaChaAdminPunNo":"-989",                   # 行政处罚数量：工商详情Full版-->Result.AdminPun
    "qiChaChaAnnoReminderCountNo":"-989",          # 公示催告数量：经营风险.公示催告：/PublishNotice/PublishNoticeList-->Paging.TotalRecords
    "qiChaChaComAddressChangeNo":"-988",           # 企查查公司地址变更次数：工商详情Full版-->Result.ChangeRecords.ProjectName='住所'的数量
    "qiChaChaComCity":"1101",                      # 企查查公司所在城市：工商详情Full版-->Result.Area.City
    "qiChaChaComProvince":"11",                    # 企查查公司所在省份：工商详情Full版-->Result.Area.Province
    "qiChaChaCompStatus":"开业",                     # 企业状态：工商详情Full版-->Result.Status
    "qiChaChaCourtAnno":"-989",                     # 法院公告数量：法律诉讼.法院公告：/CourtNoticeV4/SearchCourtAnnouncement-->Paging.TotalRecords
    "qiChaChaCourtNotice":"-989",                   # 开庭公告数量：法律诉讼.开庭公告详情查询：/CourtAnnoV4/SearchCourtNotice-->Result数量
    "qiChaChaEnvPunishCountNo":"-989",              # 环保处罚数量：经营风险.环保处罚：/EnvPunishment/GetEnvPunishmentList-->Paging.TotalRecords
    "qiChaChaEquityFreezeCountNo":"-989",           # 股权冻结数量：法律诉讼.股权冻结：/JudicialAssistance/GetJudicialAssistance-->Result.EquityUnFreezeDetail='null'的数量
    "qiChaChaEquityPleCountNo":"-989",              # 股权出质数量：法律诉讼.股权出质：/StockEquityPledge/GetStockPledgeList-->Result.Status='有效'的数量
    "qiChaChaExceptionCountNo":"1",                 # 经营异常数量：工商详情Full版-->Result.Exceptions.RemoveDate不为Null的数量
    "qiChaChaJudicialCountNo":"-989",               # 司法拍卖数量：经营风险.司法拍卖：/JudicialSale/GetJudicialSaleList-->Paging.TotalRecords
    "qiChaChaLandPledgeCountNo":"-989",             # 土地抵押数量：经营风险.土地抵押：/LandMortgage/GetLandMortgageList-->Paging.TotalRecords
    "qiChaChaLawFileCountNo":"-989",                # 裁判文书数量：法律诉讼.裁判文书：/JudgeDocV4/SearchJudgmentDoc-->Paging.TotalRecords
    "qiChaChaLegalPersonChangeNo":"-986",           # 企查查法人变更次数：工商详情Full版-->Result.ChangeRecords.ProjectName='法定代表人'的数量
    "qiChaChaLiquidation":"-989",                    # 清算数量：工商详情Full版-->Result.Liquidation
    "qiChaChaMPledgeCountNo":"-989",                 # 动产抵押数量：经营风险.动产抵押：/ChattelMortgage/GetChattelMortgage-->Paging.TotalRecords
    "qiChaChaOperName":"阮芳",                       # 法人姓名：工商详情Full版-->Result.OperName
    "qiChaChaQueryResult":"-989",                    # Status=200，则返回Y；Status=201，则返回N；其他，-989
    "qiChaChaSeriousCountNo":"-989",                 # 严重违法数量：经营风险.严重违法：/SeriousViolation/GetSeriousViolationList-->Paging.TotalRecords
    "qiChaChaShiXinItems":"0",                       # 失信数量：工商详情Full版-->Result.ShiXinItems
    "qiChaChaSimCancelCountNo":"-989",               # 简易注销数量：经营风险.简易注销：/SimpleCancellation/GetSimpleCancellation-->Paging.TotalRecords
    "qiChaChaStartMonth":"55",                       # 企业成立时长(月)：当前日期-成立日期 工商详情Full版：/ECIV4/GetFullDetailsByName-->Result.StartDate
    "qiChaChaTaxOweCountNo":"-989",                  # 欠税公告数量：经营风险.欠税公告：/TaxOweNotice/GetTaxOweNoticeList-->Paging.TotalRecords
    "qiChaChaTaxVioCountNo":"-989",                  # 税收违法数量：经营风险.税收违法：/TaxIllegal/TaxIllegalList-->Paging.TotalRecords
    "qiChaChaTeamEndMonth":"544",                    # 营业期限至今月数：工商详情Full版-->Result.TeamEnd
    "qiChaChaZhiXingItems":"0",                      # 执行数量：工商详情Full版-->Result.ZhiXingItems
    "tencentCloudBankCard4Verify":"N",                # 腾讯云-银行卡四要素验证是否一致
    "tencentRiskCode1101":"N",
    "tencentRiskCode1102":"N",
    "tencentRiskCode1103":"N",
    "tencentRiskCode1104":"N",
    "tencentRiskCode1105":"N",
    "tencentRiskCode1106":"N",
    "tencentRiskCode1107":"N",
    "tencentRiskCode1108":"N",
    "tencentRiskCode1201":"N",
    "tencentRiskCode3101":"N",
    "tencentRiskCode3103":"N",
    "tencentRiskCode3104":"N",
    "tencentRiskCode3202":"N",
    "tencentRiskScore":"89",
    "tongDunEmailNumberCount":"0",
    "tongDunFraudPoints":"12",               # 规则引擎：CSV002=100   值 >= 80  同盾欺诈分
    "tongDunFuzzyList":"N",
    "tongDunIdNumberCount":"0",
    "tongDunIdNumberHighFocusList":"N",
    "tongDunJusticeRepresentList":"N",
    "tongDunLoseFuzzyList":"N",
    "tongDunLoseList":"N",
    "tongDunLowFocusList":"Y",                # 规则引擎：NLI0019  Y=5    申请人信息命中低风险关注名单
    "tongDunMiddleFocusList":"N",
    "tongDunOneMonthPlatfromNumber":"2",      # 规则引擎：MHU004=5 3<=值<=6; MHU005=10 7<=值<=11; MHU006=100  12<=值  1个月内申请人借贷申请平台数
    "tongDunOverdueFuzzyList":"N",
    "tongDunOverdueList":"N",
    "tongDunOwingHistory":"N",
    "tongDunOwingTaxesList":"N",
    "tongDunPerformFuzzyList":"N",
    "tongDunPerformList":"N",
    "tongDunPhoneHighFocusList":"N",
    "tongDunPhoneNumberCount":"0",
    "tongDunPhoneOverdueList":"N",
    "tongDunPhoneRepaymentList":"N",
    "tongDunRepaymentList":"N",
    "tongDunRepresentList":"N",
    "tongDunSettleLawsuitList":"N",
    "tongDunSpuriousLibrary":"N",
    "tongDunThreeMonthIdNumberCount":"0",
    "tongDunThreeMonthPhoneCount":"0",
    "tongDunThreeMonthPlatfromNumber":"2",
    "tongDunThreeMonthSpouseIdNumberCount":"0",
    "tongDunThreeMonthSpousePhoneCount":"0",
    "tongDunTrumpetLibrary":"N",
    "tongDunWantedList":"N",
    "tongDunWeekPlatfromNumber":"2"            # 规则引擎：MHU001=5较多 3=值; MHU002=10过多 4<=值<=5; MHU003=100极多 6<=值  7天内申请借贷申请平台数
}